package com.kly.smartbi.bizmq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

import static com.kly.smartbi.constant.CommonConstant.MQ_CHART_EXCHANGE;
import static com.kly.smartbi.constant.CommonConstant.MQ_CHART_ROUTING_KEY;

/**
 * @author admin
 * @date 2025/4/3
 */
@Configuration
public class GenChartMessageProducer {

    @Resource
    private RabbitTemplate rabbitTemplate;

    public void sendMessage(Long chartId) {
        rabbitTemplate.convertAndSend(
                MQ_CHART_EXCHANGE,
                MQ_CHART_ROUTING_KEY,
                chartId
        );
    }
}
